package com.woniuxy.sale.service.impl;

import com.woniuxy.sale.entity.vo.SaleAddOrderItemVo;
import com.woniuxy.sale.entity.vo.UpdateItemVo;
import com.woniuxy.sale.entity.vo.UpdateSaleItemVo;
import com.woniuxy.sale.mapper.SaleOrderItemMapper;
import com.woniuxy.sale.service.SaleOrderItemService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 选货单项表; 服务实现类
 * </p>
 *
 * @author lio
 * @since 2023-09-07
 */
@Service
@Slf4j
public class SaleOrderItemServiceImpl implements SaleOrderItemService {

    @Resource
    private SaleOrderItemMapper saleOrderItemMapper;

    @Transactional
    @Override
    public boolean addItem(List<SaleAddOrderItemVo> orderItemVoList) {
        return saleOrderItemMapper.addItem(orderItemVoList);
    }

    @Transactional
    @Override
    public boolean updateCountBySidAndNumber(UpdateSaleItemVo updateSaleItemVo) {
        return saleOrderItemMapper.updateCountBySidAndNumber(updateSaleItemVo);
    }

    @Transactional
    @Override
    public boolean updateStatesBySidAndNumber(UpdateItemVo updateItemVo) {
        return saleOrderItemMapper.updateStatesBySidAndNumber(updateItemVo);
    }


}
